#include <iostream>
#include <vector>
template <class T>
typename std::vector<T>::const_iterator test(std::vector<T>& R, const T& val){
	 	R.push_back(val);
		return --R.end();
}

int main(){
	std::vector<int> vec_int;
	std::vector<int>::const_iterator it=test(vec_int,0);
	// cout << f+p << endl;
	std::cout << *it << std::endl;
	it=test(vec_int,5);
	std::cout << *it << std::endl;
	// so far so good
	
	std::vector<bool> vec_b;
	std::vector<bool>::const_iterator it_b=test(vec_b,false);
	// cout << f+p << endl;
	std::cout << *it_b << std::endl;
	it_b=test(vec_b,true);
	std::cout << *it_b << std::endl;


	return 0;
}
